#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>

using std::cin;
using std::cout;
using std::vector;

template <typename InputIterator>
void iteration(InputIterator first, InputIterator last) {
    if (first == last) {
        return;
    }
    auto max_iterator = first, last_elem_iterator = last;
    --last_elem_iterator;
    for (auto index_iterator  = first; index_iterator != last; ++index_iterator) {
        if (*index_iterator > *max_iterator) {
            max_iterator = index_iterator;
        }
    }
    iter_swap(last_elem_iterator, max_iterator);
}

template <typename InputIterator>
void my_sort(InputIterator first, InputIterator last) {
    for (auto end = last; first != end; --end) {
        iteration(first, end);
    }
}

void input(int &n, vector <int> &lst) {
    cin >> n;
    lst.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> lst[i];
    }
}

void output(const vector <int> &lst) {
    for (size_t i = 0; i < lst.size(); i++) {
        cout << lst[i] << ' ';
    }
}

int main() {
    vector <int> lst;
    int n;
    input(n, lst);
    my_sort(lst.begin(), lst.end());
    output(lst);
    return 0;
}
